package com.borderwaitmaps.client;

import java.util.ArrayList;

import com.borderwaitmaps.client.entities.BorderCrossing;
import com.borderwaitmaps.client.entities.Location;
import com.borderwaitmaps.client.entities.VehicleFlow;

public class DataProvider {

	private static DataProvider singleton = new DataProvider();
	public static DataProvider get()
	{
		return singleton;
	}
	public DataProvider()
	{
		
	}
	
	public ArrayList getBorderCrossings()
	{
		// simulate a mix of crossings
		ArrayList borderCrossings = new ArrayList();
		
		// 1 canadian crossing
		// 49.00233309,-123.0680698
		BorderCrossing crossing1 = new BorderCrossing();
		crossing1.setName("Delta, BC");
		Location location1 = new Location();
		location1.setLatitude(49.00233309);
		location1.setLongitude(-123.0680698);
		crossing1.setLocation(location1);
		crossing1.setCountry(BorderCrossing.COUNTRY_CAN);
		
		
		// canadian vehicle flow
			VehicleFlow commercial1 = new VehicleFlow();
			commercial1.getPrimaryLane().setDelay("8");
			crossing1.setCommercialVehicleFlow(commercial1);
			
			VehicleFlow passenger1 = new VehicleFlow();
			passenger1.getPrimaryLane().setDelay("1");
			crossing1.setPassengerVehicleFlow(passenger1);
		
		// 1 us crossing
		// 49.0011823,-123.0678713
		//GLatLng(49.0011823,-123.0678713);
		BorderCrossing crossing2 = new BorderCrossing();
		crossing2.setName("Point Roberts, WA");
		Location location2 = new Location();
		location2.setLatitude(49.0011823);
		location2.setLongitude(-123.0678713);
		crossing2.setLocation(location2);
		crossing2.setCountry(BorderCrossing.COUNTRY_US);
		
		// us vehicle flow
			VehicleFlow commercial2 = new VehicleFlow();
			commercial2.getPrimaryLane().setDelay("12");
			crossing2.setCommercialVehicleFlow(commercial2);
			
			VehicleFlow passenger2 = new VehicleFlow();
			passenger2.getPrimaryLane().setDelay("32");
			crossing2.setPassengerVehicleFlow(passenger2);
			
		// return
		borderCrossings.add(crossing2);
		borderCrossings.add(crossing1);
		
		
		return borderCrossings;
		
	}
}
